/**
 */
package org.xtext.tp5.mydsl.myDsl.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import org.xtext.tp5.mydsl.myDsl.Import;
import org.xtext.tp5.mydsl.myDsl.MyDslPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Import</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.xtext.tp5.mydsl.myDsl.impl.ImportImpl#getImportNameSpace <em>Import Name Space</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ImportImpl extends AbstractElementImpl implements Import
{
  /**
   * The default value of the '{@link #getImportNameSpace() <em>Import Name Space</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getImportNameSpace()
   * @generated
   * @ordered
   */
  protected static final String IMPORT_NAME_SPACE_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getImportNameSpace() <em>Import Name Space</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getImportNameSpace()
   * @generated
   * @ordered
   */
  protected String importNameSpace = IMPORT_NAME_SPACE_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected ImportImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return MyDslPackage.Literals.IMPORT;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getImportNameSpace()
  {
    return importNameSpace;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setImportNameSpace(String newImportNameSpace)
  {
    String oldImportNameSpace = importNameSpace;
    importNameSpace = newImportNameSpace;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, MyDslPackage.IMPORT__IMPORT_NAME_SPACE, oldImportNameSpace, importNameSpace));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case MyDslPackage.IMPORT__IMPORT_NAME_SPACE:
        return getImportNameSpace();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case MyDslPackage.IMPORT__IMPORT_NAME_SPACE:
        setImportNameSpace((String)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case MyDslPackage.IMPORT__IMPORT_NAME_SPACE:
        setImportNameSpace(IMPORT_NAME_SPACE_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case MyDslPackage.IMPORT__IMPORT_NAME_SPACE:
        return IMPORT_NAME_SPACE_EDEFAULT == null ? importNameSpace != null : !IMPORT_NAME_SPACE_EDEFAULT.equals(importNameSpace);
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (importNameSpace: ");
    result.append(importNameSpace);
    result.append(')');
    return result.toString();
  }

} //ImportImpl
